package cn.sjxy.regi.utils;

/**
 * ClassName:BaseContext
 * Package:cn.sjxy.regi.utils
 * Description: 基于 ThreadLocal 封装的工具类，用于保存和获取当前登录用户的 id
 *
 * @Date:2022/5/27 19:28
 * @Author:SXW
 */
public class BaseContext {

    private static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long currentId) {
        threadLocal.set(currentId);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }
}
